package com.lagou.rocketmq.service;

import org.apache.commons.io.IOUtils;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

@Service
public class SeckillService {

    @Scheduled(cron = "0 28 * * * ?")
    public void seckillStart() throws IOException {
        File from = new File("/data/nginx/seckill/seckillstart.html");
        File to = new File("/data/nginx/seckill/seckill.html");
        IOUtils.copy(new FileInputStream(from), new FileOutputStream(to));
    }

}
